using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel;

namespace ERPBackend.Models
{
    public class Warehouse : BaseModel
    {
        [Required]
        [StringLength(50)]
        public string WarehouseCode { get; set; } = string.Empty;

        [Required]
        [StringLength(255)]
        public string WarehouseName { get; set; } = string.Empty;

        [StringLength(500)]
        public string? Description { get; set; }

        [StringLength(255)]
        public string? Address { get; set; }

        [Required]
        [DefaultValue(1)]
        public byte Status { get; set; } = 1; // 0: 禁用, 1: 启用

        // 导航属性
        public ICollection<PurchaseReceipt>? PurchaseReceipts { get; set; }
    }
}